
class Cup(object):
    def __init__(self,color,height):
        self.color = color;
        self.height =  height;


    def add_property(self):
        #也可能在方法里面添加属性
        self.weight = '0.2Kg';

    def __str__(self):
        return "我是一个小小的杯子,我的颜色是 %s,我的身高是%s" %(self.color,self.height);


if __name__ == '__main__':

    cup = Cup('write','10cm');
    print(cup);
    cup.add_property();
    print(cup.weight);
    print(cup);

